import Vue from 'vue'
import App from './App.vue'

// 1 下载 router 
// 2 引入
import VueRouter from "vue-router"
// 3 使用路由插件
Vue.use(VueRouter)
// 4 创建路由规则数组 引入 组件
import Home from "./components/Home.vue"
import Classify from "./components/Classify"
import Mine from "./components/Mine"
import Order from "./components/Order"
const routes = [
  {
    path: "/",
    redirect: Home,
  },
  {
    path: "/home",
    component: Home,
  },
  {
    path: "/classify",
    component: Classify,
  },
  {
    path: "/mine",
    component: Mine,
  },
  {
    path: "/order",
    component: Order,
  },
]
// 5.创建路由对象传入规则
const router = new VueRouter({ routes: routes })
Vue.config.productionTip = false
// 6. 关联Vue 实例
new Vue({
  router: router,
  render: h => h(App),
}).$mount('#app')
